package com.shangfutai.android.keymonitoring

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.annotation.RequiresApi


/**
 * @author
 * @Description: 开机自启广播监听
 * @UpdateUser 王春
 * @UpdateDate: 2021/12/21 16:10
 * @UpdateRemark: 更新说明：
 */
class BootReceiver : BroadcastReceiver() {
    @RequiresApi(Build.VERSION_CODES.O)
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action == ACTION) {
            KeyMonitoringService.start(context)
        }
    }

    companion object {
        private const val ACTION = "android.intent.action.BOOT_COMPLETED"
    }
}